canScheduleExactAlarms

open fun canScheduleExactAlarms(@NonNull alarmManager: @NonNull AlarmManager): Boolean(source)

Called to check if the caller can schedule exact alarms. Your app schedules exact alarms when it calls any of the setExact... or setAlarmClock API methods.

Apps targeting S or higher can schedule exact alarms only if they have the SCHEDULE_EXACT_ALARM permission or they are on the device's power-save exemption list. These apps can also start ACTION_REQUEST_SCHEDULE_EXACT_ALARM to request this permission from the user.

Apps targeting lower sdk versions, can always schedule exact alarms.

Return

true if the caller can schedule exact alarms, false otherwise.

Parameters

alarmManager

AlarmManager instance used to set the alarm

See also